package com.gitee.ywj1352.consumer.service;

import com.gitee.ywj1352.client.RpcxClient;
import com.gitee.ywj1352.rpc.api.Order;
import com.gitee.ywj1352.rpc.api.OrderService;
import com.gitee.ywj1352.rpc.api.User;
import com.gitee.ywj1352.rpc.api.UserService;
import org.springframework.stereotype.Service;

@Service
public class DemoService {

    @RpcxClient(serverId = "127.0.0.1:9091")
    private UserService userService;

    @RpcxClient(serverId = "127.0.0.1:9091")
    private OrderService orderService;


    public void testRpc(){
        User user = userService.findById(1);
        System.out.println(user);
        Order order = orderService.findOrderById(1992129);
        System.out.println(order);
    }
}
